/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bpmlab.kivulifx.component;

import bpmlab.kivulifx.effects.MoveShape;
import bpmlab.kivulifx.entity.CircleModel;
import javafx.scene.shape.Circle;

/**
 *
 * @author bpmlab
 */
public class KVCircle extends Circle {
    private final MoveShape moveShape = new MoveShape();
    private CircleModel model;

    public KVCircle() {
        this(new CircleModel());
    }

    public KVCircle(CircleModel model) {
        this.model = model;
        this.translateXProperty().bindBidirectional(this.model.xProperty());
        this.translateYProperty().bindBidirectional(this.model.yProperty());
        this.radiusProperty().bindBidirectional(this.model.radiusProperty());
        this.setOnMousePressed(moveShape.getOnMousePressed());
        this.setOnMouseDragged(moveShape.getOnMouseDragged());
        this.requestFocus();
    }

    public CircleModel getModel() {
        return model;
    }

}
